package org.minuframework.common;

import java.util.Map;

public abstract class BaseController<T extends JsonResult> {

    public static final int SUCCESS_CODE = 200;
    public static final int ERROE_CODE = 500;
    public static final String DEFAULT_SUCCECC_STR = "success";
    public static final String DEFAULT_ERROR_STR = "error";

    public abstract T renderError();

    public abstract T renderError(int code);

    public abstract T renderError(String msg);

    public abstract T renderError(int code, String msg);

    public abstract T renderSuccess();

    public abstract T renderSuccess(Object data);

    public abstract T renderSuccess(Object data, long total, long pages);

    public abstract T renderSuccess(Object data, long total, long pages, int pageNum, int pageSize);

    public abstract T renderSuccess(String msg);

    public abstract T renderSuccess(String msg, Object data);

    public abstract T renderSuccess(String msg, Object data, long total, long pages);

    public abstract T renderSuccess(String msg, Object data, long total, long pages, int pageNum,
            int pageSize);

    public abstract T renderSuccess(Map<String, Object> returnMap);

}
